跳到主要内容
版本:0.1.0

Class NiceStack<T>

Assembly: RCaron.dll
View Source
Declaration
csharp
[Serializable]
public class NiceStack<T>
Declaration
csharp
[Serializable]
public class NiceStack<T>

Properties

Count

View Source
Declaration
csharp
public int Count { get; }
Declaration
csharp
public int Count { get; }

Methods

Clear()

View Source
Declaration
csharp
public void Clear()
Declaration
csharp
public void Clear()

Contains(T)

View Source
Declaration
csharp
public bool Contains(T item)
Declaration
csharp
public bool Contains(T item)
Returns

System.Boolean

Parameters
TypeName
<T>item

CopyTo(T[], int)

View Source
Declaration
csharp
public void CopyTo(T[] array, int arrayIndex)
Declaration
csharp
public void CopyTo(T[] array, int arrayIndex)
Parameters
TypeName
<T>[]array
System.Int32arrayIndex

TrimExcess()

View Source
Declaration
csharp
public void TrimExcess()
Declaration
csharp
public void TrimExcess()

Peek()

View Source
Declaration
csharp
public T Peek()
Declaration
csharp
public T Peek()
Returns

<T>

TryPeek(out T)

View Source
Declaration
csharp
public bool TryPeek(out T result)
Declaration
csharp
public bool TryPeek(out T result)
Returns

System.Boolean

Parameters
TypeName
<T>result

Pop()

View Source
Declaration
csharp
public T Pop()
Declaration
csharp
public T Pop()
Returns

<T>

TryPop(out T)

View Source
Declaration
csharp
public bool TryPop(out T result)
Declaration
csharp
public bool TryPop(out T result)
Returns

System.Boolean

Parameters
TypeName
<T>result

Push(T)

View Source
Declaration
csharp
public void Push(T item)
Declaration
csharp
public void Push(T item)
Parameters
TypeName
<T>item

EnsureCapacity(int)

Ensures that the capacity of this Stack is at least the specified <code class="paramref">capacity</code>. If the current capacity of the Stack is less than specified <code class="paramref">capacity</code>, the capacity is increased by continuously twice current capacity until it is at least the specified <code class="paramref">capacity</code>.

View Source
Declaration
csharp
public int EnsureCapacity(int capacity)
Declaration
csharp
public int EnsureCapacity(int capacity)
Returns

System.Int32: The new capacity of this stack.

Parameters
TypeNameDescription
System.Int32capacityThe minimum capacity to ensure.

ToArray()

View Source
Declaration
csharp
public T[] ToArray()
Declaration
csharp
public T[] ToArray()
Returns

<T>[]

At(Index)

View Source
Declaration
csharp
public T At(Index index)
Declaration
csharp
public T At(Index index)
Returns

<T>

Parameters
TypeName
System.Indexindex

At(int)

View Source
Declaration
csharp
public T At(int index)
Declaration
csharp
public T At(int index)
Returns

<T>

Parameters
TypeName
System.Int32index

Extension Methods